

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/favicon.png">
  <link rel="icon" href="/img/favicon.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="Han Qiu">
  <meta name="keywords" content="">
  
    <meta name="description" content="一、精灵图1、为什么需要精灵图一个网页中往往会应用很多小的背景图片作为修饰，当页面中的图像过多时，服务器就会频繁地接收和发送请求图片，造成服务器请求压力过大，这将大大降低页面的加载速度。因此为了有效地减少服务器接收和发送请求的次数，提高页面的加载速度，出现了css精灵技术（也称CSS  Sprites） 核心原理：将网页中的一些小背景图像整合到一张大图中，这样服务器只需要一次请求就可以了  2、精">
<meta property="og:type" content="article">
<meta property="og:title" content="css高级技巧">
<meta property="og:url" content="http://example.com/2022/02/14/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/index.html">
<meta property="og:site_name" content="寒秋の博客">
<meta property="og:description" content="一、精灵图1、为什么需要精灵图一个网页中往往会应用很多小的背景图片作为修饰，当页面中的图像过多时，服务器就会频繁地接收和发送请求图片，造成服务器请求压力过大，这将大大降低页面的加载速度。因此为了有效地减少服务器接收和发送请求的次数，提高页面的加载速度，出现了css精灵技术（也称CSS  Sprites） 核心原理：将网页中的一些小背景图像整合到一张大图中，这样服务器只需要一次请求就可以了  2、精">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E7%B2%BE%E7%81%B5%E5%9B%BE.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E7%B2%BE%E7%81%B5%E5%9B%BE%E4%BD%BF%E7%94%A8.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E5%AD%97%E4%BD%93%E5%9B%BE%E6%A0%87.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E5%AD%97%E4%BD%93%E5%9B%BE%E6%A0%87%E4%BD%BF%E7%94%A81.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E5%AD%97%E4%BD%93%E5%9B%BE%E6%A0%87%E4%BD%BF%E7%94%A82.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E5%AD%97%E4%BD%93%E5%9B%BE%E6%A0%87%E4%BD%BF%E7%94%A83.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E5%AD%97%E4%BD%93%E5%9B%BE%E6%A0%87%E4%BD%BF%E7%94%A84.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/css%E4%B8%89%E8%A7%92%E5%BD%A21.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/css%E4%B8%89%E8%A7%92%E5%BD%A22.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/css%E4%B8%89%E8%A7%92%E5%BD%A23.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/css%E4%B8%89%E8%A7%92%E5%BD%A24.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/css%E4%B8%89%E8%A7%92%E5%BD%A2%E5%85%BC%E5%AE%B9%E6%80%A7.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/css%E4%B8%89%E8%A7%92%E5%BD%A2%E5%BA%94%E7%94%A8.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/vertical-align%E5%B1%9E%E6%80%A7.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/vertical-align%E5%AF%B9%E9%BD%90%E6%96%B9%E5%BC%8F.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/vertical-align%E7%A4%BA%E4%BE%8B.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E5%9B%BE%E7%89%87%E5%BA%95%E9%83%A8%E7%A9%BA%E9%9A%99%E9%97%AE%E9%A2%98.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E5%8D%95%E8%A1%8C%E6%96%87%E5%AD%97%E6%BA%A2%E5%87%BA%E7%9C%81%E7%95%A5%E5%8F%B7.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E5%A4%9A%E8%A1%8C%E6%96%87%E5%AD%97%E6%BA%A2%E5%87%BA%E7%9C%81%E7%95%A5%E5%8F%B7.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E5%A4%9A%E8%A1%8C%E6%96%87%E5%AD%97%E6%BA%A2%E5%87%BA%E7%9C%81%E7%95%A5%E5%8F%B72.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/margin%E8%B4%9F%E5%80%BC%E5%BA%94%E7%94%A8.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/margin%E8%B4%9F%E5%80%BC%E5%BA%94%E7%94%A82.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/margin%E8%B4%9F%E5%80%BC%E5%BA%94%E7%94%A83.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/margin%E8%B4%9F%E5%80%BC%E5%BA%94%E7%94%A84.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/margin%E8%B4%9F%E5%80%BC%E5%BA%94%E7%94%A85.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E6%96%87%E5%AD%97%E5%9B%B4%E7%BB%95%E6%B5%AE%E5%8A%A8%E5%85%83%E7%B4%A0.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E6%96%87%E5%AD%97%E5%9B%B4%E7%BB%95%E6%B5%AE%E5%8A%A8%E5%85%83%E7%B4%A02.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E8%A1%8C%E5%86%85%E5%9D%97%E5%A6%99%E7%94%A8.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E8%A1%8C%E5%86%85%E5%9D%97%E5%A6%99%E7%94%A82.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/css%E4%B8%89%E8%A7%92%E5%BD%A2%E5%BC%BA%E5%8C%96.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/css%E4%B8%89%E8%A7%92%E5%BD%A2%E5%BC%BA%E5%8C%962.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/css%E4%B8%89%E8%A7%92%E5%BD%A2%E5%BC%BA%E5%8C%963.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/css%E4%B8%89%E8%A7%92%E5%BD%A2%E5%BC%BA%E5%8C%964.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/css%E4%B8%89%E8%A7%92%E5%BD%A2%E5%BC%BA%E5%8C%965.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/css%E4%B8%89%E8%A7%92%E5%BD%A2%E5%BC%BA%E5%8C%966.png">
<meta property="og:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/css%E4%B8%89%E8%A7%92%E5%BD%A2%E5%BC%BA%E5%8C%967.png">
<meta property="article:published_time" content="2022-02-14T03:34:51.000Z">
<meta property="article:modified_time" content="2022-02-15T02:10:24.679Z">
<meta property="article:author" content="Han Qiu">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E7%B2%BE%E7%81%B5%E5%9B%BE.png">
  
  
  <title>css高级技巧 - 寒秋の博客</title>

  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/css/bootstrap.min.css" />


  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@4/github-markdown.min.css" />
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/hint.css@2/hint.min.css" />

  
    
    
      
      <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@10/styles/github-gist.min.css" />
    
  

  
    <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.css" />
  


<!-- 主题依赖的图标库，不要自行修改 -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_ba1fz6golrf.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/css/main.css" />

<!-- 自定义样式保持在最底部 -->


  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    var CONFIG = {"hostname":"example.com","root":"/","version":"1.8.14","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"right","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"copy_btn":true,"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml"};
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
<meta name="generator" content="Hexo 6.0.0"></head>


<body>
  <header style="height: 70vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>blogs</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              &nbsp;<i class="iconfont icon-search"></i>&nbsp;
            </a>
          </li>
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="banner" id="banner" parallax=true
         style="background: url('/img/default.png') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="page-header text-center fade-in-up">
            <span class="h2" id="subtitle" title="css高级技巧">
              
            </span>

            
              <div class="mt-3">
  
  
    <span class="post-meta">
      <i class="iconfont icon-date-fill" aria-hidden="true"></i>
      <time datetime="2022-02-14 11:34" pubdate>
        2022年2月14日 中午
      </time>
    </span>
  
</div>

<div class="mt-1">
  
    <span class="post-meta mr-2">
      <i class="iconfont icon-chart"></i>
      2.9k 字
    </span>
  

  
    <span class="post-meta mr-2">
      <i class="iconfont icon-clock-fill"></i>
      
      
      25 分钟
    </span>
  

  
  
</div>

            
          </div>

          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="d-none d-lg-block col-lg-2"></div>
    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div class="py-5" id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">css高级技巧</h1>
            
            <div class="markdown-body">
              <h3 id="一、精灵图"><a href="#一、精灵图" class="headerlink" title="一、精灵图"></a>一、精灵图</h3><h4 id="1、为什么需要精灵图"><a href="#1、为什么需要精灵图" class="headerlink" title="1、为什么需要精灵图"></a>1、为什么需要精灵图</h4><p>一个网页中往往会应用很多小的背景图片作为修饰，当页面中的图像过多时，服务器就会频繁地接收和发送请求图片，造成服务器请求压力过大，这将大大降低页面的加载速度。因此<strong>为了有效地减少服务器接收和发送请求的次数，提高页面的加载速度</strong>，出现了css精灵技术（也称CSS  Sprites）</p>
<p>核心原理：将网页中的一些小背景图像整合到一张大图中，这样服务器只需要一次请求就可以了</p>
<p><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E7%B2%BE%E7%81%B5%E5%9B%BE.png" srcset="/img/loading.gif" lazyload alt="精灵图"></p>
<h4 id="2、精灵图的使用"><a href="#2、精灵图的使用" class="headerlink" title="2、精灵图的使用"></a>2、精灵图的使用</h4><p>将精灵图作为背景图片，通过background-position对精灵图位置进行调整。类似拿盒子去裁剪大图中的某个小图片</p>
<p><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E7%B2%BE%E7%81%B5%E5%9B%BE%E4%BD%BF%E7%94%A8.png" srcset="/img/loading.gif" lazyload alt="精灵图使用"></p>
<h3 id="二、字体图标"><a href="#二、字体图标" class="headerlink" title="二、字体图标"></a>二、字体图标</h3><h4 id="1、字体图标的产生"><a href="#1、字体图标的产生" class="headerlink" title="1、字体图标的产生"></a>1、字体图标的产生</h4><p>字体图标使用场景：主要用于显示网页中通用、常用的一些小图标</p>
<p>精灵图缺点：</p>
<ol>
<li>图片文件还是比较大的</li>
<li>图片本身放大和缩小会失真</li>
<li>一旦图片制作完毕想要更换非常复杂</li>
</ol>
<p>此时有一种技术的出现很好的解决了以上问题，就是字体图标iconfont（展示的是图标，本质属于字体）</p>
<h4 id="2、字体图标的优点"><a href="#2、字体图标的优点" class="headerlink" title="2、字体图标的优点"></a>2、字体图标的优点</h4><ul>
<li>轻量级：一个字体图标要比一系列的图像要小，一旦字体加载了，图标就会马上渲染出来，减少了服务器请求</li>
<li>灵活性：本质其实是文字，可以随意的改变颜色、产生阴影、透明效果、旋转等</li>
<li>兼容性：几乎支持所有浏览器</li>
</ul>
<p>注意：字体图标不能代替精灵图技术，只是对工作中图标部分技术的提升和优化</p>
<p><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E5%AD%97%E4%BD%93%E5%9B%BE%E6%A0%87.png" srcset="/img/loading.gif" lazyload alt="字体图标"></p>
<h4 id="3、字体图标下载"><a href="#3、字体图标下载" class="headerlink" title="3、字体图标下载"></a>3、字体图标下载</h4><p>推荐网站：<br>icomoon<br>阿里iconfont</p>
<h4 id="4、字体图标使用"><a href="#4、字体图标使用" class="headerlink" title="4、字体图标使用"></a>4、字体图标使用</h4><ol>
<li><p>下载字体图标</p>
</li>
<li><p>将fonts文件夹（里面有四种字体文件，为了保证兼容性）放在页面根目录下<br><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E5%AD%97%E4%BD%93%E5%9B%BE%E6%A0%87%E4%BD%BF%E7%94%A81.png" srcset="/img/loading.gif" lazyload alt="字体图标使用1"></p>
</li>
<li><p>在css样式中全局声明字体，把这些字体文件通过css引入我们的页面中。复制style.css文件中的<code>@font-face</code>样式<br><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E5%AD%97%E4%BD%93%E5%9B%BE%E6%A0%87%E4%BD%BF%E7%94%A82.png" srcset="/img/loading.gif" lazyload alt="字体图标使用2"></p>
</li>
<li><p>打开demo.html文件，复制图标对应的文本<br><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E5%AD%97%E4%BD%93%E5%9B%BE%E6%A0%87%E4%BD%BF%E7%94%A83.png" srcset="/img/loading.gif" lazyload alt="字体图标使用3"></p>
</li>
<li><p>为复制的文本添加字体样式<code>font-family</code>（属性值为font-face引入的字体）<br><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E5%AD%97%E4%BD%93%E5%9B%BE%E6%A0%87%E4%BD%BF%E7%94%A84.png" srcset="/img/loading.gif" lazyload alt="字体图标使用4"></p>
</li>
</ol>
<h4 id="5、字体图标的追加"><a href="#5、字体图标的追加" class="headerlink" title="5、字体图标的追加"></a>5、字体图标的追加</h4><p>在图标网站中导入本地的字体图标（selection.json文件），选择需要追加的图标并重新下载，覆盖原来下载的图标文件</p>
<h3 id="三、css三角形"><a href="#三、css三角形" class="headerlink" title="三、css三角形"></a>三、css三角形</h3><h4 id="1、思路"><a href="#1、思路" class="headerlink" title="1、思路"></a>1、思路</h4><ul>
<li>将一个盒子高度和宽度都设置为0，并添加边框。当4个边框为不同颜色时，会出现4种不同颜色的三角形拼成的正方形</li>
</ul>
<p><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/css%E4%B8%89%E8%A7%92%E5%BD%A21.png" srcset="/img/loading.gif" lazyload alt="css三角形1"><br><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/css%E4%B8%89%E8%A7%92%E5%BD%A22.png" srcset="/img/loading.gif" lazyload alt="css三角形2"></p>
<ul>
<li>要实现三角形，可以将其余三个边框设置为透明色。三角的大小取决于边框大小</li>
</ul>
<p><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/css%E4%B8%89%E8%A7%92%E5%BD%A23.png" srcset="/img/loading.gif" lazyload alt="css三角形3"><br><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/css%E4%B8%89%E8%A7%92%E5%BD%A24.png" srcset="/img/loading.gif" lazyload alt="css三角形4"></p>
<ul>
<li>兼容性：</li>
</ul>
<p><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/css%E4%B8%89%E8%A7%92%E5%BD%A2%E5%85%BC%E5%AE%B9%E6%80%A7.png" srcset="/img/loading.gif" lazyload alt="css三角形兼容性"></p>
<ul>
<li>应用：</li>
</ul>
<p><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/css%E4%B8%89%E8%A7%92%E5%BD%A2%E5%BA%94%E7%94%A8.png" srcset="/img/loading.gif" lazyload alt="css三角形应用"></p>
<h3 id="四、css用户界面样式"><a href="#四、css用户界面样式" class="headerlink" title="四、css用户界面样式"></a>四、css用户界面样式</h3><h4 id="1、鼠标样式"><a href="#1、鼠标样式" class="headerlink" title="1、鼠标样式"></a>1、鼠标样式</h4><p>鼠标改为小手，其他参考css基础中cursor属性<br><code>cursor: pointer;</code></p>
<h4 id="2、取消表单轮廓"><a href="#2、取消表单轮廓" class="headerlink" title="2、取消表单轮廓"></a>2、取消表单轮廓</h4><p><code>outline: none;</code></p>
<h4 id="3、防止文本域拖拽"><a href="#3、防止文本域拖拽" class="headerlink" title="3、防止文本域拖拽"></a>3、防止文本域拖拽</h4><p><code>resize: none;</code></p>
<h3 id="五、vertical-align属性应用"><a href="#五、vertical-align属性应用" class="headerlink" title="五、vertical-align属性应用"></a>五、vertical-align属性应用</h3><h4 id="1、使用"><a href="#1、使用" class="headerlink" title="1、使用"></a>1、使用</h4><ul>
<li>使用场景：经常用于设置图片或者表单（行内块元素）和文字垂直对齐</li>
<li>官方解释：用于设置一个元素的垂直对齐方式，但是它只针对行内元素或者行内块元素有有效</li>
<li>语法：<code>vertical-align: baseline | top | middel | bottom</code>（默认基线对齐）</li>
</ul>
<p><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/vertical-align%E5%B1%9E%E6%80%A7.png" srcset="/img/loading.gif" lazyload alt="vertical-align属性"><br><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/vertical-align%E5%AF%B9%E9%BD%90%E6%96%B9%E5%BC%8F.png" srcset="/img/loading.gif" lazyload alt="vertical-align对齐方式"></p>
<ul>
<li>示例：</li>
</ul>
<p><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/vertical-align%E7%A4%BA%E4%BE%8B.png" srcset="/img/loading.gif" lazyload alt="vertical-align示例"></p>
<h4 id="2、解决图片底部默认空白缝隙问题"><a href="#2、解决图片底部默认空白缝隙问题" class="headerlink" title="2、解决图片底部默认空白缝隙问题"></a>2、解决图片底部默认空白缝隙问题</h4><p>bug：图片底侧会有一个空白缝隙，原因是行内块元素会和文字的基线对齐<br>主要解决方法有两种：</p>
<ol>
<li>给图片添加<code>vertical-align: middle | top | bottom</code>（提倡使用）</li>
<li>把图片转化为块级元素<code>display: block;</code></li>
</ol>
<p><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E5%9B%BE%E7%89%87%E5%BA%95%E9%83%A8%E7%A9%BA%E9%9A%99%E9%97%AE%E9%A2%98.png" srcset="/img/loading.gif" lazyload alt="图片底部空隙问题"></p>
<h3 id="六、溢出的文字省略号显示"><a href="#六、溢出的文字省略号显示" class="headerlink" title="六、溢出的文字省略号显示"></a>六、溢出的文字省略号显示</h3><h4 id="1、单行文字溢出省略号显示"><a href="#1、单行文字溢出省略号显示" class="headerlink" title="1、单行文字溢出省略号显示"></a>1、单行文字溢出省略号显示</h4><p><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E5%8D%95%E8%A1%8C%E6%96%87%E5%AD%97%E6%BA%A2%E5%87%BA%E7%9C%81%E7%95%A5%E5%8F%B7.png" srcset="/img/loading.gif" lazyload alt="单行文字溢出省略号"></p>
<h4 id="2、多行文字溢出省略号显示"><a href="#2、多行文字溢出省略号显示" class="headerlink" title="2、多行文字溢出省略号显示"></a>2、多行文字溢出省略号显示</h4><p>多行文本溢出显示省略号，有较大的兼容性问题，适合于webKit浏览器或移动端（移动端大部分是webkit内核）</p>
<p><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E5%A4%9A%E8%A1%8C%E6%96%87%E5%AD%97%E6%BA%A2%E5%87%BA%E7%9C%81%E7%95%A5%E5%8F%B7.png" srcset="/img/loading.gif" lazyload alt="多行文字溢出省略号"><br><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E5%A4%9A%E8%A1%8C%E6%96%87%E5%AD%97%E6%BA%A2%E5%87%BA%E7%9C%81%E7%95%A5%E5%8F%B72.png" srcset="/img/loading.gif" lazyload alt="多行文字溢出省略号2"></p>
<p>更推荐让后台人员来做这个效果，因为后台人员可以设置显示多少字，操作更简单</p>
<h3 id="七、常见布局技巧"><a href="#七、常见布局技巧" class="headerlink" title="七、常见布局技巧"></a>七、常见布局技巧</h3><h4 id="1、margin负值的运用"><a href="#1、margin负值的运用" class="headerlink" title="1、margin负值的运用"></a>1、margin负值的运用</h4><ul>
<li>实现效果： 每个盒子都有边框，且边框粗细相同。鼠标经过盒子时，盒子的四个边框变色</li>
</ul>
<p><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/margin%E8%B4%9F%E5%80%BC%E5%BA%94%E7%94%A8.png" srcset="/img/loading.gif" lazyload alt="margin负值应用"></p>
<ul>
<li>思路：<ol>
<li>让每个盒子margin往左侧移动-1px（如果边框为1px），正好压住相邻盒子边框</li>
<li>鼠标经过某个盒子的时候，提高当前盒子的层级（如果没有定位，则添加相对定位（保留位置），如果有定位，则加z-index）</li>
</ol>
</li>
</ul>
<p><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/margin%E8%B4%9F%E5%80%BC%E5%BA%94%E7%94%A82.png" srcset="/img/loading.gif" lazyload alt="margin负值应用2"><br><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/margin%E8%B4%9F%E5%80%BC%E5%BA%94%E7%94%A83.png" srcset="/img/loading.gif" lazyload alt="margin负值应用3"></p>
<p><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/margin%E8%B4%9F%E5%80%BC%E5%BA%94%E7%94%A84.png" srcset="/img/loading.gif" lazyload alt="margin负值应用4"><br><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/margin%E8%B4%9F%E5%80%BC%E5%BA%94%E7%94%A85.png" srcset="/img/loading.gif" lazyload alt="margin负值应用5"></p>
<h4 id="2、文字围绕浮动元素"><a href="#2、文字围绕浮动元素" class="headerlink" title="2、文字围绕浮动元素"></a>2、文字围绕浮动元素</h4><ul>
<li>实现效果：文字环绕在图片右侧</li>
</ul>
<p><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E6%96%87%E5%AD%97%E5%9B%B4%E7%BB%95%E6%B5%AE%E5%8A%A8%E5%85%83%E7%B4%A0.png" srcset="/img/loading.gif" lazyload alt="文字围绕浮动元素"></p>
<ul>
<li>思路：为图片盒子添加左浮动，文本则会环绕在右侧</li>
</ul>
<p><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E6%96%87%E5%AD%97%E5%9B%B4%E7%BB%95%E6%B5%AE%E5%8A%A8%E5%85%83%E7%B4%A02.png" srcset="/img/loading.gif" lazyload alt="文字围绕浮动元素2"></p>
<h4 id="3、行内块的巧妙运用"><a href="#3、行内块的巧妙运用" class="headerlink" title="3、行内块的巧妙运用"></a>3、行内块的巧妙运用</h4><ul>
<li>实现效果：</li>
</ul>
<p><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E8%A1%8C%E5%86%85%E5%9D%97%E5%A6%99%E7%94%A8.png" srcset="/img/loading.gif" lazyload alt="行内块妙用"></p>
<ul>
<li>思路：<ol>
<li>行内块元素默认有间距</li>
<li>行内块元素添加<code>text-align: center;</code>属性，里面的行内元素和行内块元素都会水平居中</li>
</ol>
</li>
</ul>
<p><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/%E8%A1%8C%E5%86%85%E5%9D%97%E5%A6%99%E7%94%A82.png" srcset="/img/loading.gif" lazyload alt="行内块妙用2"></p>
<h4 id="4、css三角强化"><a href="#4、css三角强化" class="headerlink" title="4、css三角强化"></a>4、css三角强化</h4><ul>
<li>实现效果：</li>
</ul>
<p><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/css%E4%B8%89%E8%A7%92%E5%BD%A2%E5%BC%BA%E5%8C%96.png" srcset="/img/loading.gif" lazyload alt="css三角形强化"></p>
<ul>
<li>思路：<ol>
<li>将border-bottom和border-left设置为0</li>
<li>将border-top大小增加</li>
<li>将border-top设置为透明</li>
<li>将三角与需要的盒子拼接</li>
</ol>
</li>
</ul>
<p><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/css%E4%B8%89%E8%A7%92%E5%BD%A2%E5%BC%BA%E5%8C%962.png" srcset="/img/loading.gif" lazyload alt="css三角形强化2"><br><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/css%E4%B8%89%E8%A7%92%E5%BD%A2%E5%BC%BA%E5%8C%963.png" srcset="/img/loading.gif" lazyload alt="css三角形强化3"></p>
<p><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/css%E4%B8%89%E8%A7%92%E5%BD%A2%E5%BC%BA%E5%8C%964.png" srcset="/img/loading.gif" lazyload alt="css三角形强化4"><br><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/css%E4%B8%89%E8%A7%92%E5%BD%A2%E5%BC%BA%E5%8C%965.png" srcset="/img/loading.gif" lazyload alt="css三角形强化5"></p>
<p><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/css%E4%B8%89%E8%A7%92%E5%BD%A2%E5%BC%BA%E5%8C%966.png" srcset="/img/loading.gif" lazyload alt="css三角形强化6"><br><img src="https://gitee.com/huqian025/my-images/raw/master/css/css%E9%AB%98%E7%BA%A7%E6%8A%80%E5%B7%A7/css%E4%B8%89%E8%A7%92%E5%BD%A2%E5%BC%BA%E5%8C%967.png" srcset="/img/loading.gif" lazyload alt="css三角形强化7"></p>
<h3 id="八、css初始化（仅供参考）"><a href="#八、css初始化（仅供参考）" class="headerlink" title="八、css初始化（仅供参考）"></a>八、css初始化（仅供参考）</h3><p>不同浏览器对有些标签的默认值不同，为了消除不同浏览器对HTML文本呈现的差异，照顾浏览器的兼容，需要对css初始化。以京东css初始化代码为例：</p>
<figure class="highlight css"><table><tr><td class="gutter"><div class="code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br></pre></div></td><td class="code"><pre><code class="hljs css">* &#123;<br>  <span class="hljs-comment">/* 所有标签内外边距清零 */</span><br>  <span class="hljs-attribute">margin</span>: <span class="hljs-number">0</span>;<br>  <span class="hljs-attribute">padding</span>: <span class="hljs-number">0</span>;<br>&#125;<br><br><span class="hljs-selector-tag">em</span>, <span class="hljs-selector-tag">i</span> &#123;<br>  <span class="hljs-comment">/* em 和 i 斜体文字不倾斜 */</span><br>  <span class="hljs-attribute">font-style</span>: normal;<br>&#125;<br><br><span class="hljs-selector-tag">li</span> &#123;<br>  <span class="hljs-comment">/* 去掉 li 的小圆点 */</span><br>  <span class="hljs-attribute">list-style</span>: none;<br>&#125;<br><br><span class="hljs-selector-tag">img</span> &#123;<br>  <span class="hljs-comment">/* border: 0; 照顾低版本浏览器，图片外面包含了链接会有边框的问题 */</span><br>  <span class="hljs-attribute">border</span>: <span class="hljs-number">0</span>;<br>  <span class="hljs-comment">/* 取消图片底部有空白缝隙的问题 */</span><br>  <span class="hljs-attribute">vertical-align</span>: middle;<br>&#125;<br><br><span class="hljs-selector-tag">button</span> &#123;<br>  <span class="hljs-comment">/* 当鼠标经过 button 按钮的时候，鼠标变成小手 */</span><br>  <span class="hljs-attribute">cursor</span>: pointer;<br>&#125;<br><br><span class="hljs-selector-tag">a</span> &#123;<br>  <span class="hljs-comment">/* a 标签字体颜色为 #666 */</span><br>  <span class="hljs-attribute">color</span>: <span class="hljs-number">#666</span>;<br>  <span class="hljs-comment">/* 清除 a 标签下划线 */</span><br>  <span class="hljs-attribute">text-decoration</span>: none;<br>&#125;<br><br><span class="hljs-selector-tag">button</span>, <span class="hljs-selector-tag">input</span> &#123;<br>  <span class="hljs-comment">/* \5B8B\4F53 就是宋体，这样写浏览器兼容性比较好 */</span><br>  <span class="hljs-attribute">font-family</span>: Microsoft YaHei, Heiti SC, tahoma, arial, Hiragino Sans GB, <span class="hljs-string">&quot;\5B8B\4F53&quot;</span>, sans-serif;<br>&#125;<br><br><span class="hljs-selector-tag">body</span> &#123;<br>  <span class="hljs-comment">/* css3 抗锯齿，让文字显示的更加清晰 */</span><br>  -webkit-<span class="hljs-attribute">font-smoothing</span>: antialiased;<br>  <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#fff</span>;<br>  <span class="hljs-attribute">font</span>: <span class="hljs-number">12px</span>/<span class="hljs-number">1.5</span> Microsoft YaHei, Heiti SC, tahoma, arial, Hiragino Sans GB, <span class="hljs-string">&quot;\5B8B\4F53&quot;</span>, sans-serif;<br>  <span class="hljs-attribute">color</span>: <span class="hljs-number">#666</span>;<br>&#125;<br><br><span class="hljs-comment">/* 清除浮动 */</span><br><span class="hljs-selector-class">.clearfix</span><span class="hljs-selector-pseudo">::after</span> &#123;<br>  <span class="hljs-attribute">visibility</span>: hidden;<br>  <span class="hljs-attribute">clear</span>: both;<br>  <span class="hljs-attribute">display</span>: block;<br>  <span class="hljs-attribute">content</span>: <span class="hljs-string">&quot;.&quot;</span>;<br>  <span class="hljs-attribute">height</span>: <span class="hljs-number">0</span>;<br>&#125;<br><span class="hljs-selector-class">.clearfix</span> &#123;<br>  <span class="hljs-comment">/* </span><br><span class="hljs-comment">    兼容 ie，以前使用 *zoom: 1;  css3中引入 zoom属性后可以直接使用 zoom: 1;</span><br><span class="hljs-comment">  */</span><br>  zoom: <span class="hljs-number">1</span>;<br>&#125;<br></code></pre></td></tr></table></figure>

            </div>
            <hr>
            <div>
              <div class="post-metas mb-3">
                
                  <div class="post-meta mr-3">
                    <i class="iconfont icon-category"></i>
                    
                      <a class="hover-with-bg" href="/categories/css/">css</a>
                    
                  </div>
                
                
              </div>
              
                <p class="note note-warning">
                  
                    本博客所有文章除特别声明外，均采用 <a target="_blank" href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh" rel="nofollow noopener noopener">CC BY-SA 4.0 协议</a> ，转载请注明出处！
                  
                </p>
              
              
                <div class="post-prevnext">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2022/02/14/css3%E6%96%B0%E7%89%B9%E6%80%A7/">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">css3新特性</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2022/02/14/css%E5%9F%BA%E7%A1%80/">
                        <span class="hidden-mobile">css基础</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
          </article>
        </div>
      </div>
    </div>
    
      <div class="d-none d-lg-block col-lg-2 toc-container" id="toc-ctn">
        <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>

      </div>
    
  </div>
</div>

<!-- Custom -->


    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
    

    
  </main>

  <footer class="text-center mt-5 py-3">
  <div class="footer-content">
     <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
  </div>
  

  

  
</footer>


  <!-- SCRIPTS -->
  
  <script  src="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js" ></script>
<script  src="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>

<!-- Plugins -->


  <script  src="/js/local-search.js" ></script>



  
    <script  src="/js/img-lazyload.js" ></script>
  



  



  
    <script  src="https://cdn.jsdelivr.net/npm/tocbot@4/dist/tocbot.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/anchor-js@4/anchor.min.js" ></script>
  
  
    <script defer src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js" ></script>
  






  <script  src="https://cdn.jsdelivr.net/npm/typed.js@2/lib/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var title = document.getElementById('subtitle').title;
      
        typing(title);
      
    })(window, document);
  </script>















<!-- 主题的启动项 保持在最底部 -->
<script  src="/js/boot.js" ></script>


</body>
</html>
